package com.player.thirdGroup.dao;

import com.player.thirdGroup.entity.Dept;
import com.player.thirdGroup.entity.Player;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.Date;
import java.util.List;

/**
 * @author VULCAN
 * @create 2019-12-27 21:29
 * @desc 账号
 **/
public interface PlayerDao extends JpaRepository<Player, String> , JpaSpecificationExecutor<Player> {

    @Query(value = "SELECT * from sys_player where player_id=?",nativeQuery = true)
    List queryById(String id);

    @Query(value = "select count(*) from sys_player where player_status = '0'",nativeQuery = true)
    public String countunder();

    @Query(value = "select count(*) from sys_player where player_status = '1'",nativeQuery = true)
    public String countpass();

    @Query(value = "select count(*) from sys_player where player_status = '2'",nativeQuery = true)
    public String countnopass();

    List<Player> findByStatus(String status);

    @Query(value = "select distinct* from sys_player where player_year1 = ?",nativeQuery = true)
    public Player limityear2(String year1);

    @Query(value = "select * from sys_player where dept_id = ?",nativeQuery = true)
    public List<Player>  findBydeptid(String id);
}
